﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PHMEE.Migrations
{
    /// <inheritdoc />
    public partial class merge1_0BaseInfo : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "EeCiiReductionFactors",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    Year = table.Column<int>(type: "int", nullable: false),
                    Z = table.Column<float>(type: "float", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_EeCiiReductionFactors", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "EeVesselEeConfigs",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    FleetId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    Name = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IMO = table.Column<int>(type: "int", nullable: false),
                    CallSign = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    VesselType = table.Column<int>(type: "int", nullable: false),
                    NT = table.Column<float>(type: "float", nullable: false),
                    GT = table.Column<float>(type: "float", nullable: false),
                    DWT = table.Column<float>(type: "float", nullable: false),
                    FlagState = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ClassificationSociety = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    FuelTypes = table.Column<string>(type: "json", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    EEDI = table.Column<float>(type: "float", nullable: false),
                    EEXI = table.Column<float>(type: "float", nullable: false),
                    IceClass = table.Column<int>(type: "int", nullable: false),
                    MainPropulsionPowerOutput = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    AuxiliaryEnginesPowerOutput = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ManagementCompany = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    FtTanker = table.Column<float>(type: "float", nullable: false),
                    Fi = table.Column<float>(type: "float", nullable: false),
                    Fm = table.Column<float>(type: "float", nullable: false),
                    Fc = table.Column<float>(type: "float", nullable: false),
                    FiVSE = table.Column<float>(type: "float", nullable: false),
                    VToCIIs = table.Column<string>(type: "json", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CIIDefaultBound = table.Column<string>(type: "json", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_EeVesselEeConfigs", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateIndex(
                name: "IX_EeCiiReductionFactors_Year",
                table: "EeCiiReductionFactors",
                column: "Year",
                unique: true);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "EeCiiReductionFactors");

            migrationBuilder.DropTable(
                name: "EeVesselEeConfigs");
        }
    }
}
